import { foo } from "./foo.js";

const btn = document.createElement("button");
btn.innerText = "123";
btn.onclick = async () => {
  // 加载bar.js
  const result = await import("./bar.js");
  console.log(result);
}
document.body.append(btn);

console.log("main.js");

console.log(foo());;;